package com.cn.ccp.action.onlineEdu;

import java.util.List;

import org.apache.log4j.Logger;

import com.cn.ccp.action.BaseAction;
import com.cn.ccp.bean.CourseSettingBean;
import com.cn.ccp.bean.UserBean;
import com.cn.ccp.util.CCPContants;

/**
 * 在线考试列表
 * @author renyongcheng
 *
 */
public class OnlineExamListAction extends BaseAction {
	private Logger log = Logger.getLogger(OnlineExamListAction.class);
	private int totalNumber;//总共当前在线学习课程
	private String strStudentId; 
	List<CourseSettingBean>  courseList;
	
	public OnlineExamListAction(){
		log.info("---------OnlineExamListAction()--------");
		UserBean userBean = CCPContants.getUserBean();
		strStudentId = String.valueOf(userBean.getId());
		log.info("strStudentId = "+strStudentId);
		getpagedetail();
	}
	
	@Override
	public void getpagedetail() {
		if(strStudentId != null)
			totalNumber = getSelectCourseService().onlineTestCount(strStudentId);
		setItemCount(totalNumber);
		int currentpage = getCurrentPage();
		int pagesize =8;
		int start = (currentpage - 1) * pagesize;
		if(strStudentId != null){
			  courseList = getSelectCourseService().onlineTestList(strStudentId,start, pagesize);
		}
	}
 	
	
	public int getTotalNumber() {
		return totalNumber;
	}

	public String getStrStudentId() {
		return strStudentId;
	}

	public List<CourseSettingBean> getCourseList() {
		return courseList;
	}
	
}
